/*
 * LineItem.java
 *
 * Created on April 1, 2007, 2:43 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author Alirio
 */
public class LineItem {
  private Product product;
  private double quantity;
  private String unit;
  private double subtotal;
  private boolean outOfStock;
  
  /** Creates a new instance of LineItem */
  public LineItem() {
  }
  
  public LineItem(Product p, double qty, String unit, boolean outOfStock) {
    this.setProduct(p);
    this.setQuantity(qty);
    this.setUnit(unit);
    this.outOfStock = outOfStock;
    this.subtotal = p.getPrice() * qty;
  }

  public Product getProduct() {
    return product;
  }

  public void setProduct(Product product) {
    this.product = product;
  }

  public double getQuantity() {
    return quantity;
  }

  public void setQuantity(double quantity) {
    this.quantity = quantity;
  }

  public String getUnit() {
    return unit;
  }

  public void setUnit(String unit) {
    this.unit = unit;
  }

  public double getSubtotal() {
    return subtotal;
  }

  public void setSubtotal(double subtotal) {
    this.subtotal = subtotal;
  }

  public boolean isOutOfStock() {
    return outOfStock;
  }

  public void setOutOfStock(boolean outOfStock) {
    this.outOfStock = outOfStock;
  }
  
}
